package com.hzhjhh.view.manageView.menus.storage.inReturnGoods;

import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import com.hzhjhh.init.dialog.Mytable;
import com.hzhjhh.view.manageView.menus.storage.InReturnGoodsDialog;
import com.hzhjhh.view.manageView.menus.storage.constant.ShowConstants;

/**
 * 菜单栏初始化-仓库-进/退货-撤销按钮
 * 
 * @author 12083
 *
 */
public class CancelBt {

	/**
	 * 按钮
	 */
	public static JButton btInit(InReturnGoodsDialog inReturnGoodsDialog) {
		
		JScrollPane jScrollPane1 = inReturnGoodsDialog.getJScrollPane1();
		
		JButton cancel = new JButton();
		cancel.setBounds(274, 436, 81, 30);
        cancel.setText("撤   消");
        cancel.addActionListener(event -> {
        	Vector vector1 = inReturnGoodsDialog.getVector1();
        	JTable jTable1 = inReturnGoodsDialog.getJTable1();
        	vector1.removeAllElements();
            jTable1 = Mytable.maketable(vector1, ShowConstants.IN_RETURN_GOODS_HEAD_NAME); //显示内容
            jScrollPane1.getViewport().add(jTable1); //把表装入容器
        });
		return cancel;
	}
}
